<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page import="cn.edu.lingnan.pojo.Student" %>
<%@ page import="java.util.List" %>
<%@ page import="java.util.Objects" %>
<%@ page import="cn.edu.lingnan.pojo.Competition" %><%--
  Created by IntelliJ IDEA.
  User: abc20
  Date: 2024/4/23
  Time: 10:13
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <link rel="stylesheet" type="text/css" href="../css/updateAll.css">
</head>

<body>
<h1 align="center">岭南师范学院项目竞赛系统管理页面----更新页面</h1>
<hr><br><a href="/loginOut" class="link-style">注销</a>
<a href="#" onclick="window.history.back()" class="link-style">返回</a>
<div class="container">
    <form action="updateCom">
        <table>
            <tr>
                <th>比赛编号</th>
                <th>比赛名称</th>
                <th>比赛描述</th>
                <th>开始时间</th>
                <th>结束时间</th>
                <th>选择操作</th>
            </tr>
            <%
                List<Competition> competitions =(List<Competition>) session.getAttribute("competitions");
                String cid = request.getParameter("cid");
                for(Competition competition:competitions){
                    if((competition.getId()+"").equals(cid)){
            %>
            <tr>
                <td class="narrow-column"><input type="hidden" name="cid" value="<%=competition.getId()%>"><%=competition.getId()%></td>
                <td><input type="text" name="cname" value="<%=competition.getName()%>"></td>
                <td><input type="text" name="description" value="<%=competition.getDescription()%>"></td>
                <td><input type="text" name="start_time" value="<%=competition.getStart_time()%>"></td>
                <td><input type="text" name="end_time" value="<%=competition.getEnd_time()%>"></td>
                <td>
                    <input type="submit" value="确认修改"/>
                </td>
            </tr>
            <%
                }
                }
            %>

        </table>
    </form>
</div>

</body>
</html>
